﻿using Application.Models;
using Application.Roles.Commands.UpdatePermissions;
using Application.Roles.Interfaces.Repositories;
using MediatR;

namespace Application.Roles.Commands.UpdateRoles
{
    public class UpdateRolesCommandHandle(IRoleWriteRepository roleWrite) : IRequestHandler<RoleUpdaeCommand, IList<RoleDto>>
    {
        public async Task<IList<RoleDto>> Handle(RoleUpdaeCommand request, CancellationToken cancellationToken)
        {
            return await roleWrite.UpdateAsync(request, cancellationToken);
        }
    }
}
